package ch.bfh.fbi.mobicomp.zap01;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
/**
 * Let us recapitulate on how to start something via BroadcastReceiver...
 * 
 * @author SimpliX
 *
 */
public class Zap01MessageBroadcastReceiver extends BroadcastReceiver {
	private static final String TAG = "Zap01MessageBroadcastReceiver";
	private static final String DESTRUCTION_KEY = "destroyMe";
	private static final String HALT_KEY = "stopDestroyMe";

	@Override
	public void onReceive(Context context, Intent intent) {
		if (intent.getExtras().getBoolean(DESTRUCTION_KEY)) {
			Log.d(TAG, "destruction initiated...");
		} else if (intent.getExtras().getBoolean(HALT_KEY)) {
			Log.d(TAG, "destruction aborted...");
		}else{
			Log.d(TAG, "unknown command.");
		}

	}
}
